package ar.org.cfired.creditos.abm;

import java.util.HashMap;

public class Include extends Entidad{

	private int inc_id;
	private String sol_nombre;
	private String OBJNAME_;
	private String NAME_;
	private String inc_tipo;
	private String inc_url;
	
	
	public void setIncId (int inc_id) {
		this.inc_id = inc_id;
	}
	public int getIncId() {
		return (this.inc_id);
	}

	public void setSolNombre (String sol_nombre) {
		if (sol_nombre != null)
			this.sol_nombre = sol_nombre.substring(0, Math.min(255, sol_nombre.length()));
		else
			this.sol_nombre = new String();
	}
	public String getSolNombre() {
		return (this.sol_nombre);
	}

	public void setOBJNAME (String OBJNAME_) {
		if (OBJNAME_ != null)
			this.OBJNAME_ = OBJNAME_.substring(0, Math.min(255, OBJNAME_.length()));
		else
			this.OBJNAME_ = new String();
	}
	public String getOBJNAME() {
		return (this.OBJNAME_);
	}

	public void setNAME (String NAME_) {
		if (NAME_ != null)
			this.NAME_ = NAME_.substring(0, Math.min(255, NAME_.length()));
		else
			this.NAME_ = new String();
	}
	public String getNAME() {
		return (this.NAME_);
	}

	public void setIncTipo (String inc_tipo) {
		if (inc_tipo != null)
			this.inc_tipo = inc_tipo.substring(0, Math.min(3, inc_tipo.length()));
		else
			this.inc_tipo = new String();
	}
	public String getIncTipo() {
		return (this.inc_tipo);
	}

	public void setIncUrl (String inc_url) {
		if (inc_url != null)
			this.inc_url = inc_url.substring(0, Math.min(255, inc_url.length()));
		else
			this.inc_url = new String();
	}
	public String getIncUrl() {
		return (this.inc_url);
	}
	

	
	@Override
	public String getCriterioBusqueda2() {
		String busqueda = " from Include ";
		boolean filtro = false;
		//ArrayList a = new ArrayList();
		
		if(this.getIncId() > 0){
			if(!filtro){
				busqueda += " where " + " inc_id = " + this.getIncId();
			filtro = true;
			}
			else
				busqueda += " and " + " inc_id = " + this.getIncId();
		}
		
		if(this.getSolNombre() != null){
			if(!filtro){
				busqueda += " where " + " sol_nombre = " + this.getSolNombre();
			filtro = true;
			}
			else
				busqueda += " and " + " sol_nombre = " + this.getSolNombre();
		}
		
		if(this.getOBJNAME() != null){
			if(!filtro){
				busqueda += " where " + "OBJNAME_ = " + this.getOBJNAME();
			filtro = true;
			}
			else
				busqueda += " and " + "OBJNAME_ = " + this.getOBJNAME();
		}

		if(this.getNAME() != null){
			if(!filtro){
				busqueda += " where " + "NAME_ = " + this.getNAME();
			filtro = true;
			}
			else
				busqueda += " and " + "NAME_ = " + this.getNAME();
		}
				
		if(this.getIncUrl() != null){
			if(!filtro){
				busqueda +=  " where " + "inc_tipo = '" + this.getIncUrl()+ "' ";
			filtro = true;
			}
			else
				busqueda +=  " and " + "inc_tipo = '" + this.getIncUrl()+ "' ";
		}	
		
		if(this.getIncUrl() != null){
			if(!filtro){
				busqueda += " where " + "inc_url = " + this.getIncUrl();
			filtro = true;
			}
			else
				busqueda += " and " + "inc_url = " + this.getIncUrl();
		}
			
		return  busqueda;
		}

	@Override
	public void setVariables(HashMap<String, Object> variables) {
		// TODO Auto-generated method stub
		
	}
	
	
}
